<?php
ob_start();
	include("common/connection.php");
	$newpassword=$_POST["password"];
	$uid=$_POST['uid'];
	$oldPass=$_POST['oldPass'];
	
	//$getAdminId;
	////////////////At the end of the table////////////
	if(isset($newpassword))
	{ 
	$queryUser="SELECT * FROM admin WHERE admin_pass='".$oldPass."' AND admin_id='".$uid."'";
	$resultUser=mysql_db_query($db_name,$queryUser);
	$rsUser=mysql_fetch_array($resultUser);
	$password=$rsUser[admin_pass];

	if($password!=$oldPass)
	{
		header("location: containeradmin.php?area=admin&action=change_password&mess=3");
	}
		else
		{ 
		 $addProGP="UPDATE `admin` SET `admin_pass`='$newpassword' WHERE `admin_id`='$uid'";
		 $resultProGP=mysql_db_query($db_name,$addProGP);
		 
			if($resultProGP)
			{//echo"successfully inserted";
				header("Location: containeradmin.php?area=admin&action=change_password&mess=1");
			}
			else
			{
				header("Location: containeradmin.php?area=admin&action=change_password&mess=2");
			}
		}
	}
	
	//mysql_clos

?>
